<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments/header::header">
    <title>Title</title>
</head>
<body>
<div class="container">
    <div class="row">
        <h2 th:text="${userModel.title}"></h2>
    </div>
    <div class="row">
        <p>
            <a class="btn btn-primary" th:href="@{/users/create}">创建用户</a>
        </p>
    </div>
    <div class="row">
        <table class="table table-hover">
            <thead>
            <tr>
                <td>用户名</td>
                <td>密码</td>
                <td>邮箱</td>
            </tr>
            </thead>
            <tbody>
            <tr th:if="${userModel.userList.size() eq 0}">
                <td colspan="3">暂无用户信息！</td>
            </tr>
            <tr th:each="user : ${userModel.userList}">
                <td><a th:href="@{'/users/'+${user.id}}" th:text="${user.name}"></a></td>
                <td th:text="${user.password}"></td>
                <td th:text="${user.email}"></td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<footer th:replace="fragments/footer::footer"></footer>
</body>
</html>